﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace MyCommon.Configuration
{
    /// <summary>
    /// 自定义的配置节分组
    /// </summary>
    public class CustomSectionGroup : ConfigurationSectionGroup
    {
        /// <summary>
        /// 示例配置节
        /// </summary>
        public SampleSection Sample
        {
            get
            {
                if (Sections["sample"] == null)
                {
                    Sections.Add("sample", new SampleSection());
                }
                return Sections["sample"] as SampleSection;
            }
        }
        /// <summary>
        /// 示例配置节
        /// </summary>
        public PasswordOverwriteSection PasswordOverwrite
        {
            get
            {
                if (Sections["passwordOverwrite"] == null)
                {
                    Sections.Add("passwordOverwrite", new PasswordOverwriteSection());
                }
                return Sections["passwordOverwrite"] as PasswordOverwriteSection;
            }
        }
    }
}
